package com.atguigu.daijia.map.client;

import com.atguigu.daijia.common.result.Result;
import com.atguigu.daijia.model.form.map.SearchNearByDriverForm;
import com.atguigu.daijia.model.form.map.UpdateDriverLocationForm;
import com.atguigu.daijia.model.vo.map.NearByDriverVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-map")
public interface LocationFeignClient {

/**
 * 开启接单服务：
 * 更新司机经纬度位置
 * @param updateDriverLocationForm
 * @return
 */
@PostMapping("/map/location/updateDriverLocation")
    Result<Boolean>updateDriverLocation(@RequestBody UpdateDriverLocationForm updateDriverLocationForm);
/**
 * 关闭接单服务：
 * 删除司机经纬度位置
 * @param driverId
 * @return
 */
@PostMapping("/map/location/removeDriverLocation/{driverId}")
    Result<Boolean>removeDriverLocation(@PathVariable("driverId") Long driverId);
/**
 * 搜索附近满足条件的司机
 * @param searchNearByDriverForm
 * @return
 */
@PostMapping("/map/location/searchNearbyDriver")
    Result<List<NearByDriverVo>>searchNearbyDriver(@RequestBody SearchNearByDriverForm searchNearByDriverForm);
}